package com.deke.order.service.Impl;

import cn.hutool.core.util.ObjectUtil;
import com.deke.entity.Video;
import com.deke.order.dao.VideoDao;
import com.deke.order.service.VideoService;
import com.deke.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 1.0
 * @Author :LiM
 * @Date :2022/12/28 13:28
 */
@Service
public class VideoServiceImpl implements VideoService {
    @Autowired
    private VideoDao videoDao;
    @Override
    public Result queryVideoByCourseId(String courseId) {
        List<Video> videos = videoDao.queryVideoByCourseId(courseId);
        if(ObjectUtil.isNotNull(videos)){
            return new Result(2000,"查询视频成功",videos);
        }
        return new Result(0000,"查询失败",null);
    }
}
